package com.feng.eduservice.controller.front;

import com.feng.commonutils.R;
import com.feng.eduservice.entity.EduCourse;
import com.feng.eduservice.frontvo.CourseFrontVo;
import com.feng.eduservice.service.EduCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@CrossOrigin
@RequestMapping("/eduservice/coursefront")
public class CourseFrontController {
    @Autowired
    private EduCourseService eduCourseService;
    /*** 条件查询带分页**/
    @PostMapping("getFrontCouseList/{page}/{limit}")
    public R getFrontCourseList(@PathVariable long page, @PathVariable long limit,
                                @RequestBody(required = false) CourseFrontVo courseFrontVo){
       return eduCourseService. getFrontCourseList(page,limit,courseFrontVo);
    }
    @GetMapping("getFrontCourseInfo/{courseId}")
    public R getFrontCourseInfo(@PathVariable String courseId, HttpServletRequest request){
        return eduCourseService.getFrontCourseInfo(courseId,request);
    }
}
